use rust_client_demo::protos::js_engine::{js_engine_client::JsEngineClient, ExecuteRequest};
use tonic::Result;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = JsEngineClient::connect("http://0.0.0.0:12345").await?;

    let request = tonic::Request::new(ExecuteRequest {
        script: "1 + 1".to_string(),
    });

    let response = client.execute(request).await?;

    println!("{:?}", response.into_inner().result);

    Ok(())
}
